home *** CD-ROM | disk | FTP | other *** search
/ TOS Silver 2000 / TOS Silver 2000.iso / online / CONN97 / CONNECT / SCRIPTS / DOWNLOAD.SCR < prev    next >
Encoding:
Text File  |  1994-07-28  |  5.7 KB  |  255 lines

  1. # Interaktiv vorbereiteter Download mit ConNect
  2. # Version 2.0, 19/07/94, 07:27:32 Uhr
  3.  
  4. NAME="Andreas Schrell"
  5. PASS="xxxxxx"
  6. Maus="rs"
  7.  
  8. # Pfade für Dateien:
  9. DOWNLOAD="e:\\dfue\\download"
  10. FILELIST="e:\\dfue\\download\\files"
  11.  
  12. # Pfade für den Tausch:
  13. sendfile='e:\\dfue\\cat\\export\\infile.txt'
  14. recepath='e:\\dfue\\cat\\import'
  15.  
  16. TIMEOUT=30
  17.  
  18. # Fileliste in $Maus$GPTNAME.lzh umbenennen? = 1, sonst = 0
  19. # cp und rm müssen vorhanden sein und keine Dateien $Maus-*.lzh
  20. # im Filelistenverzeichnis. Mauskürzel ggf. in Kleinbuchstaben!
  21. UMBENENNEN=1
  22.  
  23. echo ""
  24. echo "Interaktiv vorbereiteter Download aus der $Maus"
  25. echo ""
  26.  
  27. echo -n "Andere Maus (.=$Maus): "
  28. read eingabe
  29. if [ "$eingabe" != "." ]; then
  30.     Maus="$eingabe"
  31. fi
  32.  
  33. echo -n "Anderer Name (.=$NAME): "
  34. read eingabe
  35. if [ "$eingabe" != "." ]; then
  36.     NAME="$eingabe"
  37. fi
  38.  
  39. if [ "$NAME" != "gast" ]; then
  40.     echo -n "Anderes Pass (.=$PASS): "
  41.     read eingabe
  42.     if [ "$eingabe" != "." ]; then
  43.         PASS="$eingabe"
  44.     fi
  45. else
  46.     PASS=""
  47. fi
  48.  
  49. echo "Daten: [$Maus] [$NAME] [$PASS]"
  50.  
  51. echo ""
  52.  
  53. function xwaitfor {
  54.      waitfor -t $TIMEOUT "Leertaste -" "$1" "$2" "$3" "$4" "$5"
  55.      if [ $WAITID -eq 0 ]; then
  56.           echo "Timeout"
  57.           hangup
  58.         exit
  59.      fi
  60.      if [ $WAITID -eq 1 ]; then
  61.           send -n " "
  62.           xwaitfor "$1"
  63.      fi
  64. }
  65.  
  66. function fileliste {
  67.      send -n a
  68.      xwaitfor "Eingabe:"
  69.      send -n o
  70.      xwaitfor "dauern" "Packer:"
  71.     if [ $WAITID -eq 2 ]; then
  72.          send -n j
  73.         xwaitfor "Packer:"
  74.     fi
  75.      send -n l
  76.      xwaitfor "Protokoll"
  77.      send -n Z
  78.      xwaitfor "B00"
  79.      download -p "$FILELIST"
  80.     if [ $UMBENENNEN -eq 1 ]; then
  81.         rm -f "$FILELIST\\$Maus$GPTNAME.lzh"
  82.         if cp $FILELIST\\$Maus-*.lzh "$FILELIST\\$Maus$GPTNAME.lzh"; then
  83.             rm $FILELIST\\$Maus-*.lzh
  84.         fi
  85.     fi
  86.      xwaitfor "Eingabe:"
  87. }
  88.  
  89.  
  90. function mylogin {
  91.     dial -s 10 -r 100 -v "$Maus "
  92.      xwaitfor "Benutzer? (J/N)"
  93.      send -n j
  94.      xwaitfor "Name"
  95.      send $NAME
  96.      xwaitfor "ssword"
  97.      send $PASS
  98.      xwaitfor "Eingabe:"
  99.      send -n p
  100.      xwaitfor "Eingabe:"
  101.      waitfor -t 10 "nglich" "Eingabe:"
  102.     if [ $WAITID -eq 1 ]; then
  103.         echo "Programmteil z. Zt. nicht zugänglich."
  104.         xwaitfor "Eingabe:"
  105.         send -n i
  106.         xwaitfor "Eingabe:"
  107.         send -n l
  108.         hangup
  109.         exit
  110.     fi
  111. }
  112.  
  113. function gastlogin {
  114.     dial -s 10 -r 100 -v "$Maus "
  115.      xwaitfor "Benutzer? (J/N)"
  116.      send -n n
  117.      xwaitfor "eintragen"
  118.      send -n n
  119.      xwaitfor "Eingabe:"
  120.      send -n p
  121.      waitfor -t 3 "nglich" "Eingabe:"
  122.     if [ $WAITID -eq 1 ]; then
  123.         echo "Programmteil z. Zt. nicht zugänglich."
  124.         xwaitfor "Eingabe:"
  125.         send -n i
  126.         xwaitfor "Eingabe:"
  127.         send -n l
  128.         hangup
  129.         exit
  130.     fi
  131. }
  132.  
  133. function gpt {
  134.      send -n g
  135.      xwaitfor "=Hilfe):"
  136.      send $1
  137.      xwaitfor "Eingabe:"
  138.     GPTNAME=$1
  139. }
  140.  
  141. function opt {
  142.      send -n o
  143.      xwaitfor "Eingabe:"
  144.     GPTNAME=OEFF
  145. }
  146.  
  147. function sauge {
  148.      send -n e
  149.      xwaitfor "Protokoll"
  150.      send -n z
  151.      xwaitfor "Welche"
  152.      send $1
  153.      xwaitfor "B00"
  154.      download -p "$DOWNLOAD"
  155.      xwaitfor "Eingabe:"
  156. }
  157.  
  158. function ende {
  159.      send -n z
  160.      xwaitfor "Eingabe:"
  161.     if [ $BEENDEN -eq 1 ]; then
  162.          send -n s
  163.         hangup
  164.     fi
  165. }
  166.  
  167. function tausch {
  168.     send -n z
  169.     xwaitfor -t 17 Eingabe:
  170.     send -n t
  171.     xwaitfor -t 16 \[0m:' '
  172.     send -n z
  173.     xwaitfor -t 18 B01
  174.     upload "$sendfile"
  175.     xwaitfor -t 43 B00
  176.     download -p "$recepath"
  177.     xwaitfor Eingabe:
  178.     send -n p
  179. }
  180.  
  181. if [ "$NAME" = "gast" ]; then
  182.     echo "gastlogin" > dl.scr
  183. else
  184.     echo "mylogin" > dl.scr
  185. fi
  186.  
  187. echo "Maus=$Maus" >> dl.scr
  188.  
  189. Ende=0
  190.  
  191. function Hilfe {
  192.     echo "Beispiele für die Auswahl:"
  193.     echo "o 1 4 18      = Sauge im ÖPT die Files 1 4 18"
  194.     echo "g tex 4 18    = Sauge im GPT tex die Files 4 18"
  195.     echo "o fl          = Fileliste des ÖPT"
  196.     echo "g tex fl      = Fileliste des GPT tex"
  197.     echo "t             = MausTausch"
  198.     echo "s             = Login und Starten"
  199.     echo "S             = wie "s" aber am Ende in der Maus bleiben"
  200.     echo "x             = Abbruch"
  201.     echo "?             = Hilfe"
  202. }
  203.  
  204. while [ $Ende -eq 0 ]
  205. do
  206.      echo -n "Auswahl (?=Hilfe): "
  207.      read teil gpt files
  208.     if [ "$teil" = "x" ]; then
  209.         echo "Abbruch".
  210.         exit
  211.     fi
  212.      if [ "$teil" != "s" -a "$teil" != "S" ]; then
  213.           if [ "$teil" = "g" ]; then
  214.                echo "gpt $gpt" >> dl.scr
  215.           else
  216.             if [ "$teil" = "?" ]; then
  217.                 Hilfe
  218.                 break 3
  219.             else
  220.                 if [ "$teil" = "t" ]; then
  221.                     if ! [ -f $sendfile ]; then
  222.                         echo "Es gibt kein Infile!"
  223.                         break 5;
  224.                     fi
  225.                     echo "tausch" >> dl.scr
  226.                 else
  227.                        echo "opt" >> dl.scr
  228.                       if [ "$files" != "" ]; then
  229.                           files="$gpt $files"
  230.                      else
  231.                          files="$gpt"
  232.                      fi
  233.                 fi
  234.             fi
  235.           fi
  236.           if [ "$files" = "fl" ]; then
  237.                echo "fileliste" >> dl.scr
  238.           else
  239.             if [ ! "$files" = "" ]; then
  240.                    echo "sauge \"$files\"" >> dl.scr
  241.             fi
  242.           fi
  243.      else
  244.           Ende=1
  245.         if [ "$teil" = "S" ]; then
  246.             echo "BEENDEN=0" >> dl.scr
  247.         else
  248.             echo "BEENDEN=1" >> dl.scr
  249.         fi
  250.           echo "ende" >> dl.scr
  251.      fi
  252. done
  253.  
  254. . dl.scr
  255.